/*
 * @Author: your name
 * @Date: 2020-08-18 14:37:46
 * @LastEditTime: 2020-08-19 11:12:46
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \blockchain\src\utils\tool\getDate - 副本.js
 */
import util from '@/libs/util'
/**
 * @dev 得到导出的链接，
 * @params url 导出的链接
 * @params obj 导出的参数限制
 */
function goSearch(url, obj, type) {
    let toGo = url;
    let token = util.cookies.get('token');
    let uuid = util.cookies.get('uuid');
    let _is_export = 1;
    let params = `&token=${token}&uuid=${uuid}&_is_export=${_is_export}`;
    for (let i in obj) {
        if (toGo.indexOf('?') > 0) {
            toGo += ('&' + i + '=' + obj[i])
        } else {
            toGo += ('?' + i + '=' + obj[i])
        }
    };
    toGo = `${toGo}${params}`;
    if (type == 1) {
        window.location.href = toGo;
    } else {
        window.open(toGo);
    }
}
export default {
    goSearch
}

